#pragma once

#include <arpa/inet.h>

#include <string>

using std::string;

class InetAddr
{
public:
    InetAddr(const string &ip, unsigned int port);
    InetAddr(const struct sockaddr_in &addr);
    ~InetAddr();
    string ip() const;
    unsigned int port() const;
    const struct sockaddr *getAddrPtr() const;
    struct sockaddr_in *getAddrinPtr();
private:
    struct sockaddr_in _addr;
};